package com.wen.springcloud.dubbo.service;

import com.wen.springcloud.dubbo.api.ISayHelloService;
import com.wen.springcloud.dubbo.entity.User;
import com.wen.springcloud.dubbo.mapper.UserMapper;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * @author Wen
 * @date 2022/11/14 23:42
 */
@DubboService(version = "2.0")
public class SayHelloService implements ISayHelloService {
    private final UserMapper userMapper;

    public SayHelloService(UserMapper userMapper) {this.userMapper = userMapper;}

    @Override
    public String say(String msg) {
        userMapper.insert(new User().setAge(18).setName("Wen"));
        return msg;
    }
}